package com.tgit.sso.paltform.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * ClassName: ExecutorTaskUtil
 * date: 2019/11/25 20:11
 * Description: TODO
 *
 * @author fanzj@tgit.com
 * @since JDK 1.8
 */
public class ExecutorTaskUtil {
    private static ExecutorService executorService= Executors.newFixedThreadPool(10);

    public static void sendEmail(String receive,String msg){
        Runnable runnable=()->{
            try {
                SendTextMailUtil.sendEmail(receive,msg);
            } catch (Exception e) {
                System.out.println(Thread.currentThread().getName());
                e.printStackTrace();
                Thread.currentThread().setDaemon(true);
            }
        };
        executorService.submit(runnable);
    }

}
